<?php
	include_once("../model/Acesso.class.php");
	include_once("../model/Mensagem.class.php");
	include_once("../model/Administradora.class.php");
	include_once("../model/Fornecedor.class.php");
	include_once("../model/Produto.class.php");
	$prod = new Produto();
	$acesso = new Acesso();
	$fornecedor = new Fornecedor();
	$codigoPagina = "7";
	if ($acesso->verificaPermissaoUsuario($codigoPagina)){
		$banco = $acesso->getBanco();
?>
<html>
<head>
<title>:.:.:INGECAMP:.:.:</title>
<link href="../arquivosExtra/estilo.css" rel="stylesheet" type="text/css">
<style type="text/css">
	body{
		background-color:#FFFFFF;
		background-image:none;
	}
</style>
<script language="javascript" src="../arquivosExtra/funcoesJavaScript.js"></script> 
</head>

<body topmargin="0" leftmargin="0">
<table width="100%" border="2" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#CCCCCC" class="letraCabecalho">SIG-INGECAMP- Sistema de Gerenciamento Geral - INGECAMP - Via Internet</td>
  </tr>
  <tr>
    <td height="21" align="center" valign="top">
<table width="100%" border="0" cellspacing="0">
        <tr> 
          <td height="57" valign="bottom"><table width="100%" border="0" cellspacing="0">
              <tr> 
                <td height="26" colspan="5" align="center" class="letraCampo"><img src="../imagens/logo.jpg" width="569" height="96"></td>
              </tr>
              <tr> 
                <td height="22" valign="bottom">&nbsp;</td>
                <td colspan="2" valign="middle">&nbsp;</td>
                <td valign="middle">&nbsp;</td>
                <td valign="bottom">&nbsp;</td>
              </tr>
              <tr> 
                <td width="12%" height="39" valign="bottom">&nbsp;</td>
                <td width="61%" valign="middle"> <div align="right"> 
                    <input type="button" name="Submit2" value="Pagina Principal" class="botaoUsuario2" onClick="Redireciona()">
                  </div></td>
                <td width="2%" valign="middle">&nbsp;</td>
                <td width="11%" valign="middle"><div align="center"> 
                    <input type="button" name="Submit223" value="Logoff" class="botaoUsuario2" onClick="formLogoff()">
                  </div></td>
                <td width="14%" valign="bottom">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table>
      <form id="formCadEntradaEstoque" name="formCadEntradaEstoque" method="post" action="../control/controlCadEntrada.php">
        <table width="996" height="239" border="2" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td width="23%" height="21" bgcolor="#CCCCCC" class="letraCabecalho"> 
              <div align="center" class="letraCabecalho">Cadastro de Entrada No Estoque </div></td>
          </tr>
          <tr> 
            <td height="214" align="left" valign="top"><table width="100%" border="0">
                <tr> 
                  <td width="74%" height="9" align="right"><table width="100%" border="0">
                    <tr>
                      <td width="14%" align="right"><span class="letraCampo">Fornecedor:</span></td>
                      <td width="33%"><select name="forn" class="caixaTexto" id="forn">
                          <?php
					  	$clies = $fornecedor->getAllFornecedor($banco);
						while($temp = mysql_fetch_row($clies)){
							echo("<option value=\"$temp[0]\">$temp[1]</option>");
							
						}
                      ?>
                      </select></td> 
                      <td width="20%" class="letraCampo">Numero de Produtos Nota: </td>
                      <td width="33%"><select name="num_prod_nota" class="caixaTexto" id="num_prod_nota" onChange="criarLinhasEntrada(this.value)">
                        <option value="0" selected>0</option>
                        <option value="1">1</option>
                        <option value="2">2</option>
                        <option value="3">3</option>
                        <option value="4">4</option>
                        <option value="5">5</option>
                        <option value="6">6</option>
                        <option value="7">7</option>
                        <option value="8">8</option>
                        <option value="9">9</option>
                        <option value="10">10</option>
                        <option value="11">11</option>
                        <option value="12">12</option>
                        <option value="13">13</option>
                        <option value="14">14</option>
                        <option value="15">15</option>
                        <option value="16">16</option>
                        <option value="17">17</option>
                        <option value="18">18</option>
                        <option value="19">19</option>
                        <option value="20">20</option>
                        <option value="21">21</option>
                        <option value="22">22</option>
                        <option value="23">23</option>
                        <option value="24">24</option>
                        <option value="25">25</option>
                        <option value="26">26</option>
                        <option value="27">27</option>
                        <option value="28">28</option>
                        <option value="29">29</option>
                        <option value="30">30</option>
                        <option value="31">31</option>
                        <option value="32">32</option>
                        <option value="33">33</option>
                        <option value="34">34</option>
                        <option value="35">35</option>
                        <option value="36">36</option>
                        <option value="37">37</option>
                        <option value="38">38</option>
                        <option value="39">39</option>
                        <option value="40">40</option>
                                                                  </select></td>
                    </tr>
                  </table></td>
                </tr>
                <tr>
                  <td height="10" align="right"><table width="100%" border="0">
                    <tr>
                      <td width="15%" align="right"><span class="letraCampo">Data NF:</span></td>
                      <td width="13%"><input name="dt_nf" type="text" id="dt_nf" size="15" maxlength="10" class="caixaTexto" value="<?php $z = $acesso->getDataAcesso(); echo("$z"); ?>" onKeyPress="mascara(this, mdata)"></td>
                      <td width="12%" align="right"><span class="letraCampo">Data Entrada:</span></td>
                      <td width="12%"><input name="dt_ent" type="text" id="dt_ent" size="15" maxlength="10" class="caixaTexto" value="<?php $z = $acesso->getDataAcesso(); echo("$z"); ?>" onKeyPress="mascara(this, mdata)"></td>
                      <td width="12%" align="right"><span class="letraCampo">Numero NF:</span></td>
                      <td width="36%"><input name="numero_nf" type="text" id="numero_nf" size="20" maxlength="18" class="caixaTexto"></td>
                    </tr>
                  </table></td>
                </tr>
                <tr> 
                  <td height="40" align="center" class="letraCampo">Produtos Nota </td>
                </tr>
                
                <tr>
               	  <td>
                    	<div id="conteiner">
                        
                		</div>
                   </td>
                </tr>
               	 
 
                
                <tr>
                  <td height="21" align="right" class="letraCampo">&nbsp;</td>
                </tr>
                <tr>
                  <td height="9" align="right" class="letraCampo">&nbsp;</td>
                </tr>
                <tr>
                  <td height="10" align="right" class="letraCampo"><table width="100%" border="0">
                    <tr>
                      <td width="82%" align="right" class="letraCampo">Valor Total Entrada: </td>
                      <td width="18%"><input name="vte" value="0" type="text" id="vte" size="12" class="caixaTexto" readonly="readonly"></td>
                    </tr>
                  </table></td>
                </tr>
                <tr>
                  <td height="21" align="right" class="letraCampo">&nbsp;</td>
                </tr>
                <tr>
                  <td height="21" align="right" class="letraCampo"><table width="100%" border="0">
                    <tr>
                      <td width="52%" align="right"><input type="button" name="Submit3" onClick="validarEntradaProdutos()"value="Cadastrar Entrada" class="botoes"></td>
                      <td width="3%">&nbsp;</td>
                      <td width="45%"><input type="button" name="Submit3" value="Cancelar" class="botoes" onClick="Redireciona()"></td>
                    </tr>
                  </table></td>
                </tr>
                
              </table></td>
          </tr>
        </table>
        <p>&nbsp;</p>
     </form>
      <p>&nbsp;</p>
  </tr>
  <tr>
    <td height="21" bgcolor="#CCCCCC"><table width="100%" border="0" cellspacing="0">
        <tr> 
           <td width="302" align="right"> 
            <input name="textfield" type="text" class="informacoesLogin" value="Usu&aacute;rio:  <?php $x = $acesso->getLoginUsuarioLogado(); echo("$x"); ?>" readonly="readonly"> 
          </td>
          <td width="17">&nbsp;</td>
          <td width="144"><input name="textfield2" type="text" class="informacoesLogin" value="Entrada &agrave;s:  <?php $y = $acesso->getHoraAcesso(); echo("$y"); ?>" readonly="readonly"></td>
          <td width="17">&nbsp;</td>
          <td width="303">
<input name="textfield22" type="text" class="informacoesLogin" value="Data: <?php $z = $acesso->getDataAcesso(); echo("$z"); ?>" readonly="readonly">
          </td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
<?php
}else{
		$msg = new Mensagem();
		$msg->informaMensagem(005,$acesso->getPaginaPrincipal());
	}?>